<h1>Job selection</h1>

<h2>Selecting the Resource Manager (Job Launcher)</h2>
<i>Padb</i> supports many resource managers and should select
the appropriate one for your cluster, if you have more than
one resource manager installed or <i>padb</i> can't detect
the correct one use the <b>rmgr</b> <a href=#config>configuration option</a>.

<p>If no resource manager is found you can use <b>-O rmgr=local</b> and process
identifiers (pids) will be used instead of job ids.

<p>The <b>--list-rmgrs</b> option can be used to show a list of detected
resource managers and their active jobs.

<h2>Selecting the job(s) to target</h2>
<i>Padb</i> provides several ways for the user to select which jobs
to target depending on requirements.  All jobs detected by padb are
identified by a unique numeric "jobid", typically this maps directly
only a identifier provided by the underlying resource manager.
The default is to target jobs of the current user, this can be
over-ridden with the <b>--user</b> flag.

<h3>Showing list of current jobs</h3>
To show a list of currently running jobs for a given user use the
<b>--show-jobs</b> option.  Alternatively the <b>--list-rmgrs</b> option
shows a list of detected resource managers along with a list of currently active jobs for each of them.

<h3>To target all jobs</h3>
To target all jobs currently running for a given user use the <b>--all</b> (<b>-a</b>) flag.

<h3>To target any jobs</h3>
To target "any" job currently running for a given user use the <b>--any</b> (<b>-A</b>) flag.
This differs from targeting all jobs as it will exit with an error if more
than one job is running.

<h3>To target a specific job</h3>
To target a specific job specify the jobid for the job on the command line,
after all other options.

<a name=full-report</a><h3>To target a specific job (Full report option)</h3>
If trying to diagnose a problem or gather information there is another
option, <b>--full-report=&lt;jobid&gt;</b>, this tells padb to target the job
specified and to report all information about the job it knows how to
collect.  This option is typically used when creating bug reports to
send to third parties or to inspect a job for anomalies.

<hr>

<h1>Selecting ranks (Processes)</h1>
In modes where data for each process is reported separately it is possible
to restrict which ranks are queried, this is done via the <b>--rank</b> option.
Multiple ranks can be selected by specifying <b>--rank</b> multiple times.

<hr>

<h1>Selecting which mode to run in.</h1>
<i>Padb</i> can present an array of different information about your
select jobs and it can present it in a number of different ways.  With
the exception of Full Report only one mode can be selected, if you need
more information about the program run <i>padb</i> more than once.

<h2>Full Report</h2>
If you are just starting with <i>padb</i> or are creating an error
report for somebody else then the <b>--full-report=&lt;jobid&gt;</b> option is a good place
to start, this will complete a full diagnostic report for the job
iterating over the more common padb options.  For large jobs this can
generate a lot of output so redirecting to a file is recommended.

<p>

A list of avaliable modes and their descriptions can be found on the <a href=/modes>modes</a> page.

<hr>

<a name=config></a><h1>Configuration options</h1>
<i>padb</i> has a number of extended configuration options for tuning
it's behavior, these can be set in a number of ways.  All configuration
options are key/value pairs.
<ul>
<li>Command line</li>
Use the command-line option <b>--config-option &lt;key&gt;=&lt;value&gt;</b>.
<b>-O</b> can be substituted for <b>--config-option</b>.
<li>Environment</li>
Set the environment variable <b>PADB_&lt;KEY&gt;=&lt;value&gt;</b>.  All 
environment variables should be specified in upper case.
<li>Config file</li>
Config is also loaded from <b>/etc/padb.conf</b> and <b>~/.padbrc</b>.  Contact the
<a href=/email>mailing lists</a> for help with these files.
</ul>
A list of configuration options along with their current values can be
obtained by specifying a key of help with or without a value, i.e. <b>padb -Ohelp</b>

<h2>Example</h2>
<table border=1>
<tr><td>
<pre>
ashley@alpha:~$ padb --show-jobs
Error, multiple resource managers detected, use -Ormgr=<resource manager>
orte slurm local-fd local
ashley@alpha:~$ padb --show-jobs --config-option rmgr=orte
59315
ashley@alpha:~$ export PADB_RMGR=orte
ashley@alpha:~$ padb --show-jobs
59315
ashley@alpha:~$ 
</pre>
</td></tr>
</table>
